﻿<!DOCTYPE html>
<html lang="zh">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="renderer" content="webkit">
    <meta charset="utf-8" />
    <title>@ViewBag.Title</title>
    <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/bootstrap")
    <script src="~/Scripts/bootstrap-ie.js"></script>
    @RenderSection("header", false)
</head>
<body>
    <div>
        @Html.Partial("Header")
        <div class="way">
            <sapn>当前位置：</sapn>
            / <a href="/">首页</a> / <a href="#">房源信息</a> / @(ViewBag.Title)
        </div>


        <div class="list-title">
            <div class="list-title-word">出售房源信息</div>
        </div>
        <div class="classify-bg">
            <div style="overflow: hidden;" class="classify">
                <span style="font-weight: bold; color: #333; padding-left: 8px;">地区：</span>
                <div style="position: relative; top: -30px; left: 40px; overflow: hidden;">
                    <ul id="cityTab" class="nav nav-tabs">
                        <li></li>
                        @{
                            int i = 0;
                            int j = 0;
                            int k = 0;
                            Dictionary<int, string> dicCity = new Dictionary<int, string>();
                            Dictionary<int, string> dicArea = new Dictionary<int, string>();
                        }
                        @foreach (var item in HouseAgencySite.Utils.ParamHelper.Areas(0, "全部", "", true))
                        {
                       
                            <li class="tab-pane @(i == 0 ? "in active" : "")">
                                <a href="#Areas@(i)" data-toggle="tab">
                                    @item.Text
                                </a>
                            </li>
                            dicCity.Add(i, item.Text);
                            i++;
                        }
                    </ul>
                    <div id="cityTabContent" class="tab-content">
                        @foreach (var key in dicCity.Keys)
                        {
                            <div class="tab-pane fade in @(j == 0 ? "Active" : "")" id="Areas@(key)">
                                <ul id="AreaTab" class="nav nav-tabs">
                                    @{
                            var areaList = HouseAgencySite.Utils.ParamHelper.Areas(1, dicCity[key], "", true);
                                    }
                                    @foreach (var area in areaList)
                                    {
                                        <li class=" @(j == 0 ? "active" : "")">
                                            <a href="#Address@(j)" data-toggle="tab">
                                                @area.Text
                                            </a>
                                        </li> 
                                        dicArea.Add(j, area.Text);
                                        j++;
                                    }
                                </ul>
                            </div>
                        }
                    </div>
                    <div id="areaTabContent" class="tab-content">
                        @foreach (var key in dicArea.Keys)
                        {
                            <div class="tab-pane fade in " id="Address@(key)">
                                <ul id="AreaAddr" class="nav nav-tabs">
                                    @{
                            var listAddress = HouseAgencySite.Utils.ParamHelper.Areas(2, dicArea[key], "", true);
                                    }
                                    @foreach (var addr in listAddress)
                                    {
                                        <li class=" @(k == 0 ? "active" : "")">
                                            <a href="#Add" data-toggle="tab">@addr.Text </a>
                                        </li>
                                        k++;
                                    }
                                </ul>
                            </div>
                        }
                    </div>
                </div>
            </div>
            <div class="classify">
                <ul class="list-inline" id="price">
                    <li><span>单价：</span></li>
                    <li class="btn btn-info btn-xs list-select">不限</li>
                    <li>500元</li>
                    <li>600元</li>
                    <li>700元</li>
                    <li>800元</li>
                    <li>900元</li>
                    <li>1000元</li>
                    <li>1500元</li>
                    <li>2000元</li>
                    <li>3000元</li>
                    <li>
                        <input type="text" name="PriceLeft" id="PriceLeft" size="10" class="classify-input">-<input type="text" name="PriceRight" class="classify-input" id="PriceRight" size="10">
                    </li>
                </ul>
            </div>
            <div class="classify">
                <ul class="list-inline" id="mianji">
                    <li><span>面积：</span></li>
                    <li class="btn btn-info btn-xs list-select">不限</li>
                    <li>20㎡</li>
                    <li>30㎡</li>
                    <li>40㎡</li>
                    <li>50㎡</li>
                    <li>80㎡</li>
                    <li>100㎡</li>
                    <li>120㎡</li>
                    <li>150㎡</li>
                    <li>200㎡</li>
                    <li>300㎡</li>
                    <li>
                        <input type="text" name="MianJiLeft" class="classify-input" id="MianJiLeft" size="10">-<input type="text" name="MianJiRight" class="classify-input" id="MianJiRight" size="10">
                    </li>
                </ul>
            </div>
            <div class="classify">
                <ul class="list-inline" id="huxing">
                    <li><span>户型：</span></li>
                    @foreach (var item in HouseAgencySite.Utils.ParamHelper.HuXing(true, ""))
                    {
                        if (item.Text == "全部")
                        { 
                        <li class="huxing-item btn btn-info btn-xs list-select" t="@item.Value">@item.Text</li>
                        }
                        else
                        {
                        <li class="huxing-item" t="@item.Value">@item.Text</li>
                        }
                    }
                </ul>
            </div>
            <div class="text-center">
                <input id="btnSearchList" class="btn btn-info" type="button" value="搜索" />&nbsp;&nbsp;
                <button id="btnResetSearch" class="btn btn-info ">重置</button>
            </div>
        </div>
        @RenderBody()

        <div style="background: #428bca; line-height: 60px; color: white;">
            @Html.Partial("Footer")
        </div>
    </div>

    <script>
        $(function () {
            $("li", "#cityTab").click(function () {
                var city = $(this).find("a").html();
                if (city == "全部") {
                    $("#areaTabContent").hide();
                    $("#cityTabContent").hide();
                } else {
                    $("a:last", $(this).find("a").attr("href")).tab("show");
                    $("a:first", $(this).find("a").attr("href")).tab("show");
                    $("a:first", $("a:first", $(this).find("a").attr("href")).attr("href")).tab("show");
                    $("#areaTabContent").show();
                    $("#cityTabContent").show();
                }
            });

        });

    </script>
</body>
</html>
